package edu.cqie.smartfarm.verify.anno;

import edu.cqie.smartfarm.verify.validation.PhoneValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented // 元注解
@Target(ElementType.FIELD)// 作用于字段上
@Retention(RetentionPolicy.RUNTIME)
@Constraint(
        validatedBy = { PhoneValidation.class }
)
public @interface Phone {
    //提供校验失败后的提示信息
    String message() default "请输入正确手机号格式";
    //指定分组
    Class<?>[] groups() default {};
    //负载，获取到State注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
